package com.bootdo.system.controller;

import com.bootdo.common.utils.PageUtils;
import com.bootdo.common.utils.R;
import com.bootdo.system.domain.TbPunchBackground;
import com.bootdo.system.service.PunchBackgroundService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @create 2021-03-08 21-59
 */
@Api("推送图片")
@Controller
@RequestMapping("/system/punch")
public class PunchBackground {

    @Autowired
    private PunchBackgroundService punch;

    @GetMapping("/list")
    @ResponseBody
    public PageUtils selectPunchList(Map map){
        return punch.selectPunchBackgroundList(map);
    }

    @PostMapping("/addd")
    public R addPunch(TbPunchBackground punchBackground){
        return punch.addPunchBackground(punchBackground);
    }

    @PostMapping("/update")
    public R updatePunch(TbPunchBackground punchBackground){
        punch.updatePunchBackground(punchBackground);
        return R.ok();
    }
}
